import { axios } from "@/utils/request";
import { baseUrl } from "@/services/baseUrl";
//查询图片列表
export const getImageList = (data) =>
  axios({
    url:
      baseUrl +
      `/report/reportImages/getPageSet?pageNo=${data.page}&pageSize=${data.pageSize}`,
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    method: "POST",
  });

//上传图片
export function uploadBimImage(data) {
  return axios({
    url: baseUrl + "/report/reportVisual/put-file.api",
    method: "POST",
    data,
  });
}

//保存图片
export function saveImage(data) {
  return axios({
    url: baseUrl + "/report/reportImages/save",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    method: "POST",
    data,
  });
}

//删除图片
export function deleteImage(data) {
  let { uuid } = data;
  return axios({
    url: baseUrl + `/report/reportImages/deleteBatch?varchar=${uuid}`,
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    method: "POST",
  });
}

//全景展示-模型列表
export function getModelTreeList(data) {
  return axios({
    url: baseUrl + `/probusiness/blackHole3D/project/modelTree/nodeList`,
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    method: "POST",
    data,
  });
}
//全景展示-模型列表-子节点的构件
export function dataSetFileTreeNodes(data) {
  return axios({
    url:
      baseUrl + `/probusiness/blackHole3D/project/dataSet/dataSetFileTreeNodes`,
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    method: "POST",
    data,
  });
}

//全景展示-模型列表-获取场景下所有列表
export function getModalTreeById(data) {
  return axios({
    url: baseUrl + `/probusiness/blackHole3D/project/sceneTree/getTreeById`,
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    method: "POST",
    data,
  });
}

//全景展示-模型列表-获取场景下构件id集合
export function getModalTreeElemIdsById(data) {
  return axios({
    url: baseUrl + `/probusiness/blackHole3D/project/element/getTreeChildren`,
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    method: "POST",
    data,
  });
}

//全景展示-标记列表
export function pageMarker(data) {
  let { page, pageSize } = data;
  return axios({
    url:
      baseUrl +
      `/probusiness/bimMarkMain/getPageSet?pageNo=${page}&pageSize=${pageSize}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//全景展示-标记列表-导出
export function exportMarkerExcel(data) {
  return axios({
    url: baseUrl + `/probusiness/bimMarkMain/exportData`,
    method: "POST",
    apiType: "file",
    responseType: "arraybuffer",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//全景展示-漫游列表
export function getRoamList(data) {
  return axios({
    url: baseUrl + `/probusiness/bimRoamMain/getRoamList`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//全景展示-漫游-新增路径
export function saveOrUpdateRoam(data) {
  return axios({
    url: baseUrl + `/probusiness/bimRoamMain/saveOrUpdateData`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//全景展示-漫游-删除路径
export function deleteRoam(data) {
  let { uuid } = data;
  return axios({
    url: baseUrl + `/probusiness/bimRoamMain/deleteData?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
  });
}
//全景展示-漫游-查询详情
export function detailRoam(data) {
  let { uuid } = data;
  return axios({
    url: baseUrl + `/probusiness/bimRoamMain/getDetailByUuid?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
  });
}
//全景展示-标记-详情
export function detailMarkers(data) {
  let { uuid } = data;
  return axios({
    url: baseUrl + `/probusiness/bimMarkMain/getDetailByUuid?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
  });
}
//全景展示-基础属性
export function getElementParam(data) {
  return axios({
    url: baseUrl + `/probusiness/blackHole3D/project/element/getElementParam`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//全景展示-基础属性-导出
export function exportElementExcel(data) {
  return axios({
    url:
      baseUrl + `/probusiness/blackHole3D/project/element/exportElementParam`,
    method: "POST",
    apiType: "file",
    responseType: "arraybuffer",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//全景展示-扩展属性
export function getElementExtendParams(data) {
  return axios({
    url:
      baseUrl +
      `/probusiness/blackHole3D/project/element/getElementExtendParams`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//全景展示-扩展属性-导出
export function exportExtendExcel(data) {
  return axios({
    url:
      baseUrl + `/probusiness/blackHole3D/project/element/exportElementExtend`,
    method: "POST",
    apiType: "file",
    responseType: "arraybuffer",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//全景展示-扩展属性-分类
export function getElementExtendParamGroups(data) {
  return axios({
    url:
      baseUrl +
      `/probusiness/blackHole3D/project/element/getElementExtendParamGroups`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//全景展示-扩展属性-新增分类
export function addElementExtendParamGroup(data) {
  return axios({
    url:
      baseUrl +
      `/probusiness/blackHole3D/project/element/addElementExtendParamGroup`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//全景展示-扩展属性-编辑分类
export function updateElementExtendParamGroup(data) {
  return axios({
    url:
      baseUrl +
      `/probusiness/blackHole3D/project/element/updateElementExtendParamGroup`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//全景展示-扩展属性-分类删除
export function deleteElementExtendParamGroup(data) {
  return axios({
    url:
      baseUrl +
      `/probusiness/blackHole3D/project/element/deleteElementExtendParamGroup`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//全景展示-扩展属性-属性新增
export function addElementExtendParams(data) {
  return axios({
    url:
      baseUrl +
      `/probusiness/blackHole3D/project/element/addElementExtendParams`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//全景展示-扩展属性-属性编辑
export function updateElementExtendParam(data) {
  return axios({
    url:
      baseUrl +
      `/probusiness/blackHole3D/project/element/updateElementExtendParam`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//全景展示-扩展属性-属性删除
export function deleteElementExtendParamById(data) {
  return axios({
    url:
      baseUrl +
      `/probusiness/blackHole3D/project/element/deleteElementExtendParamById`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//全景展示-批注列表-导出
export function exportCommentExcel(data) {
  return axios({
    url: baseUrl + `/probusiness/bimCommentMain/exportData`,
    method: "POST",
    apiType: "file",
    responseType: "arraybuffer",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//全景展示-批注列表-导出
export function exportExcel(params) {
  return axios({
    url: baseUrl + `/system/sysOperationLog/exportStatFile`,
    method: "GET",
    apiType: "file",
    responseType: "arraybuffer",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    params,
  });
}

//查询变更日志
export function versionHistory(data) {
  return axios({
    url: baseUrl + `/probusiness/blackHole3D/project/modelTree/versionHistory`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//查询版本对比
export function versionContrast(data) {
  return axios({
    url: baseUrl + `/probusiness/blackHole3D/project/versionContrast/list`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//查询版本对比权限
export function supportInvariantUniqueId(data) {
  return axios({
    url:
      baseUrl +
      `/probusiness/blackHole3D/project/dataSet/supportInvariantUniqueId`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//发起对比
export function initiateVersionContrast(data) {
  return axios({
    url: baseUrl + `/probusiness/blackHole3D/project/versionContrast`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
